Carbon


SeedCFill

Header: Quickdraw.h Carbon status: Supported

Determines how far filling will extend to pixels matching the color of a particular pixel.

void SeedCFill (
    const BitMap *srcBits, 
    const BitMap *dstBits, 
    const Rect *srcRect, 
    const Rect *dstRect, 
    SInt16 seedH, 
    SInt16 seedV, 
    ColorSearchUPP matchProc, 
    SInt32 matchData
);
Parameter descriptions
srcBits

The source image. If the image is in a pixel map, you must coerce its PixMap structure to a BitMap structure.

dstBits

On return, the destination mask.

srcRect

The rectangle of the source image.

dstRect

The rectangle of the destination image.

seedH

The horizontal position of the seed point.

seedV

The vertical position of the seed point.

matchProc

An optional color search function.

matchData

Data for the optional color search function.

DISCUSSION

The SeedCFill function generates a mask showing where the pixels in an image can be filled from a starting point, like the paint pouring from the MacPaint paint-bucket tool. This mask is a bitmap filled with 1’s to indicate all pixels adjacent to a seed point whose colors do not exactly match the RGBColor structure for the pixel at the seed point. You can then use this mask with the CopyBits, CopyMask, and CopyDeepMask functions.

You specify a source image in the srcBits parameter and, in the srcRect parameter, specify a rectangle within that source image. You specify where to begin seeding in the seedH and seedV parameters, which must be the horizontal and vertical coordinates of a point in the local coordinate system of the source bitmap. By default, the 1’s returned in the mask indicate all pixels adjacent to the seed point whose pixel values do not exactly match the pixel value of the pixel at the seed point. To use this default, set the matchProc and matchData parameters to 0.

In generating the mask, SeedCFill uses the CopyBits function to convert the source image to a 1-bit mask. The SeedCFill function installs a default color search function that returns 0 if the pixel value matches that of the seed point; all other pixel values return 1’s.

The SeedCFill function does not scale so the source and destination rectangles must be the same size. Calls to SeedCFill are not clipped to the current port and are not stored into QuickDraw pictures.

To customize SeedCFill, write your own color search function and point to it in the matchProc parameter; SeedCFill will then use your function instead of the default.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)